home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / text / hyper / hsc_source.lha / hsc / source / ugly / utypes.h < prev   
C/C++ Source or Header  |  1996-11-17  |  2KB  |  107 lines

  1. #ifndef UGLY_TYPES_H
  2. #define UGLY_TYPES_H
  3.  
  4. /*
  5.  * ugly/types.h
  6.  *
  7.  * ugly data typing.
  8.  *
  9.  * NOTE: contains also UGLY_VER and UGLY_REV and
  10.  * includes debuggin defines
  11.  *
  12.  * (W) by Tommy-Saftwörx 1994,95,96
  13.  *
  14.  * updated: 30-Jul-1996
  15.  * created: 25-Jan-1994
  16.  */
  17.  
  18. /* include debugging defines */
  19. #include "udebug.h"
  20.  
  21. /*
  22.  * are you running a amiga?
  23.  */
  24.  
  25. #if 0 /* defined AMIGA */
  26.  
  27. /*
  28.  * on amiga system, just include system types
  29.  */
  30.  
  31. #include <exec/types.h>
  32.  
  33. /*
  34.  *
  35.  * no amiga -> normal typedefs
  36.  *
  37.  */
  38.  
  39. #else
  40.  
  41. #ifndef APTR_TYPEDEF
  42. #define APTR_TYPEDEF
  43. typedef void *APTR;             /* 32-bit untyped pointer */
  44. #endif
  45. typedef long LONG;              /* signed 32-bit quantity */
  46. typedef unsigned long ULONG;    /* unsigned 32-bit quantity */
  47. typedef short WORD;             /* signed 16-bit quantity */
  48. typedef unsigned short UWORD;   /* unsigned 16-bit quantity */
  49. #if __STDC__
  50. typedef signed char BYTE;       /* signed 8-bit quantity */
  51. #else
  52. typedef char BYTE;              /* signed 8-bit quantity */
  53. #endif
  54. typedef unsigned char UBYTE;    /* unsigned 8-bit quantity */
  55.  
  56. #ifdef __cplusplus
  57. typedef char *STRPTR;           /* string pointer (NULL terminated) */
  58. #else
  59. typedef unsigned char *STRPTR;  /* string pointer (NULL terminated) */
  60. #endif
  61.  
  62. /* Types with specific semantics */
  63. typedef void VOID;
  64. typedef short BOOL;
  65. typedef unsigned char TEXT;
  66.  
  67. #ifndef TRUE
  68. #define TRUE            1
  69. #endif
  70. #ifndef FALSE
  71. #define FALSE           0
  72. #endif
  73. #ifndef NULL
  74. #define NULL            0L
  75. #endif
  76.  
  77. #define BYTEMASK        0xFF
  78. #define WORDMASK        0xFFFF
  79.  
  80. #endif /* AMIGA */
  81.  
  82. /*
  83.  *
  84.  * global typedefs (on any system)
  85.  *
  86.  */
  87.  
  88. typedef const unsigned char *CONSTRPTR;         /* string constants */
  89. typedef unsigned char STRARR;   /* string array */
  90. typedef unsigned char CHAR;     /* single character */
  91.  
  92. /*
  93.  * UPTR as an generic pointer. C-math will not operate on UPTR.
  94.  * UPTR can be converted to any other pointer and the other way round.
  95.  * It is used by ugly functions, especially the umx-functions
  96.  */
  97. typedef void *UPTR;             /* generic pointer ( ANSI-def ) */
  98.  
  99. /*
  100.  * compare/delete function type
  101.  */
  102. typedef int cmp_func(UPTR data1, UPTR data2);
  103. typedef void del_func(UPTR data);
  104.  
  105. #endif /* UGLY_TYPES_H */
  106.  
  107.